<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>UI元素状态伪类选择器</title>
        <style>
            #user:hover{background-color: #ccc;}
            #user:focus{color:white;background-color: red;}
            #user:active{background-color: #ffcc00;}
        </style>
    </head>
    <body>
       请输入你的姓名：<input type="text" name="user" id="user">
    </body>
</html>